Dynomotion

Group: DynoMotion Message: 13140 From: engnerdan Date: 4/12/2016
Subject: MPG Jog Pendant Issues
Tom,
I my mill has been out of commission for over a year. I just got it back up and running, part of that process was to update to the latest software version (4.33) and clean up my C programs. But now I can't get the jog pendant to work. The encoder is wired the same as it always was (new wire, but same wiring configuration)


I tried deleting out all my MPG related code and paste in the code from the "MPGSmoothHardwareEnc.c" example. But there is nearly no documentation in that program as to what values to change and what they are supposed to be. So maybe I am doing something wrong.

 

My C programs are structured like this

Thread 1 - MODBUS master and external buttons

Thread 2 - Axis initialization parameters

Thread 3 - Homing routine and soft limit parameters to be issued after homing.


I have attached a copy of the three programs, can you tell me if there is something wrong in the code? It worked before the machine broke Dec 2014, but doesn't now.


Thanks,

Dan

  @@attachment@@
Group: DynoMotion Message: 13141 From: Dan W Date: 4/12/2016
Subject: Re: MPG Jog Pendant Issues [3 Attachments]
Attachments :
The previous initialization file is where I ended up yesterday and just gave up. Attached to this message is what I had working over a year ago with all the extra stuff deleted out. 

Dan


Sent via the Samsung Galaxy S®6 active, an AT&T 4G LTE smartphone


Group: DynoMotion Message: 13158 From: Dan W Date: 4/18/2016
Subject: Re: MPG Jog Pendant Issues [3 Attachments]
Can anybody tell me if there is something wrong with this code? 

Dan



Sent via the Samsung Galaxy S®6 active, an AT&T 4G LTE smartphone


Group: DynoMotion Message: 13159 From: Tom Kerekes Date: 4/19/2016
Subject: Re: MPG Jog Pendant Issues
Hi Dan,

Try basic debugging/troubleshooting.

Does the Axis Position update on the Axis Screen when you move the pendent encoder wheel?

Do the proper I/O's change on the Digital I/O Screen when you change the pendent switches?

Regards
TK


On 4/18/2016 2:20 PM, Dan W engnerdan@... [DynoMotion] wrote:
 

Can anybody tell me if there is something wrong with this code? 

Dan



Sent via the Samsung Galaxy S®6 active, an AT&T 4G LTE smartphone


Group: DynoMotion Message: 13168 From: Dan W Date: 4/19/2016
Subject: Re: MPG Jog Pendant Issues
Ok I got the jog to work. It was the 8 pin RJ45 cable between the Kflop and KANALOG again (mine doesn't want to say latched in). I have wedged a piece of wire insulation under the latch tab for now. 

I was thinking my lack of counts on the axis screen was due to the C code.

-Dan



Sent via the Samsung Galaxy S®6 active, an AT&T 4G LTE smartphone


Group: DynoMotion Message: 13190 From: Dan W Date: 4/22/2016
Subject: Re: MPG Jog Pendant Issues
Tom,
I got to thinking about something that threw me off. Maybe you can explain it to me or maybe there is something up with the example code.  I have 3 code examples below, can you explain why I can't get the example code to work and have to do something different?


In the "MPGSmoothHardwareEnc.c" file, the code after the axis parameters and before the for loop is this
 
    EnableAxisDest(0,ch0->Position);
    DefineCoordSystem(0,-1,-1,-1);
   
    Pos = chan[MPG_INPUT_AXIS].Position;


When I change it to this to match that my MPG is wired into channel 7 it does not work

    EnableAxisDest(7,ch0->Position);
    DefineCoordSystem(0,1,2,-1);

    Pos = chan[MPG_INPUT_AXIS].Position;


What works is this

    DefineCoordSystem(0,1,2,-1);
    EnableAxisDest(7,0);

    Pos = chan[MPG_INPUT_AXIS].Position;



Thanks,
Dan
Group: DynoMotion Message: 13191 From: Tom Kerekes Date: 4/22/2016
Subject: Re: MPG Jog Pendant Issues
Hi Dan,

You might read this:
http://www.dynomotion.com/wiki/index.php?title=Channels_Channels_Channels

You aren't supplying enough information for me to be able to tell what you are trying to do or what you are actually configuring.

But basically you should be clear about two things that are completely different and independent:

#1 which encoder input device the MPG is wired to

#2 which KFLOP axis channel will be used to keep track of the encoder Position (MPG_INPUT_AXIS - default example is 6).  Note that this is normally a dummy axis channel that isn't usually even enabled because it doesn't have any associated motor and doesn't need to be enabled to only track encoder position.

The statement:

EnableAxisDest(7,ch0->Position);

doesn't make any sense to me.  Is KFLOP Axis channel 7 even used?  If it is used in conjunction with encoder 7 it doesn't need to be enabled.  Why would it be set to the position of Axis 0?
HTH
Regards
TK




On 4/22/2016 12:37 PM, Dan W engnerdan@... [DynoMotion] wrote:
 

Tom,
I got to thinking about something that threw me off. Maybe you can explain it to me or maybe there is something up with the example code.  I have 3 code examples below, can you explain why I can't get the example code to work and have to do something different?


In the "MPGSmoothHardwareEnc.c" file, the code after the axis parameters and before the for loop is this
 
    EnableAxisDest(0,ch0->Position);
    DefineCoordSystem(0,-1,-1,-1);
   
    Pos = chan[MPG_INPUT_AXIS].Position;


When I change it to this to match that my MPG is wired into channel 7 it does not work

    EnableAxisDest(7,ch0->Position);
    DefineCoordSystem(0,1,2,-1);

    Pos = chan[MPG_INPUT_AXIS].Position;


What works is this

    DefineCoordSystem(0,1,2,-1);
    EnableAxisDest(7,0);

    Pos = chan[MPG_INPUT_AXIS].Position;



Thanks,
Dan